package com.yh.doing.memento;

/**
 * @program: design-patterns
 * @description: ${description}
 * @author: yangh0597@163.com
 * @date: 2021-03-11 12:37
 * @problem:
 **/
public class Client {
    public static void main(String[] args) {


        User user = new User();

        user.setStatus("login");

        Memento memento = user.createMemento();

        Careker careker = new Careker(memento);


        user.setStatus("out");
        System.out.println(user.getStatus());


        user.restoreMento(careker.getMemento());
        System.out.println(user.getStatus());


    }
}
